package dto

import (
	"comm/selfreg"
	"core/class"
	"reflect"
)

type CommDataDto struct {
	Id int64 `json:"id,string"  bson:"_id"    gorm:"column:id;primaryKey;autoIncrement:false;comment:主键;"`

	Sid string `json:"sid"                         gorm:"column:sid;size:50;comment:设备编号;"`

	Method string `json:"method"                         gorm:"column:method;size:10;comment:上传下发;"`
	CrtDt  string `json:"crtDt"   bson:"-"     validate:""   gorm:"column:crt_dt;not null;comment:数据时间;"`
	Data   string `json:"data"                         gorm:"column:data;size:2000;comment:原始数据;"`
	Memo   string `json:"memo"      validate:"max=800"   gorm:"column:memo;size:800;DEFAULT:'';not null;comment:备注;"`

	CommPortId  int64 `json:"commPortId,string"                         gorm:"column:comm_port_id;comment:协议类型;"`
	CommProxyId int64 `json:"commProxyId,string"                         gorm:"column:comm_proxy_id;comment:代理程序;"`
}

func init() {

	var mcls = &CommDataDto{}
	var m = &class.MyClass{
		Name:     "设备通讯数据Dto",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  "",
		Type:     reflect.TypeOf(mcls),
	}
	selfreg.AddDto(m)
}
